<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>CRM</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
	<link rel="stylesheet" href="css/jquery.validity.css"/>
</head>
<body>
	<%@ include file="include/loginhead.jsp" %>
	
	<div class="container" style="margin-top:60px">
			<div class="page-header">
				<h4>忘记了密码？</h4>
			</div>
		
<form novalidate="novalidate" method="post" id="user-form" class="simple_form new_user" action="resetpwd.jspx" accept-charset="UTF-8">
	<div class="control-group email required"><label for="user_email" class="email required control-label">
	<abbr title="required">*</abbr> 请输入注册时使用的Email</label>
	<div class="controls">
	<input type="text" title="Email" value="" size="50" placeholder="Email" name="user.email" id="user_email"/>
	</div>
	</div>

	<button type="button" id="commit" class="btn">发送重置密码邮件</button>
</form>
<div>
	  <a href="/crm/index.jspx">登录</a><br/>
	  <a href="/crm/gosign.jspx">创建帐号</a><br/>
	  <a href="/crm/newConfirmation.jspx">没有收到确认邮件?</a><br/>
</div>
</div>
	<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/jquery.validity.js"></script>
	<script type="text/javascript" charset="UTF-8" src="js/jquery.validity.lang.zh.js"></script>
	
	<script type="text/javascript">
		$(function() {
			var result;
			function checkEmail() {
				$.ajaxSetup({
				  async: false
				});
				$.post("checkRconfirmationEmail.jspx",{"user.email" : $("#user_email").val()}, function(msg){
					result = msg;
				});
				
				return result;
			}
			
			$("#user-form").validity(function() {
				$("#user_email").require().match("email").assert(checkEmail() != 1 && (result == 0 || result == 2), "邮箱未激活！").assert(result != 0 && (result == 2 || result == 1), "信息错误，请核实！");
			});
			
			$("#commit").click(function() {
				$("#user-form").submit();
			});
		});
	</script>
</body>
</html>
